#!/bin/bash
src1=//192.168.1.101/f
src2=//192.168.1.101/F_share
src3=//192.168.1.101/Users
src4=//192.168.1.100/ee
src5=//192.168.1.100/ff
src6=//192.168.1.100/gg
src7=//192.168.1.100/hh
src8=//192.168.0.148/hh

dest1=/home/mnt/win
dest2=/home/mnt/bb
dest3=/home/mnt/cc
dest4=/home/mnt/ee
dest5=/home/mnt/ff
dest6=/home/mnt/gg
dest7=/home/mnt/hh
dest8=/home/mnt/company

stlink_home=/home/gg/018_src/stlink/build/Release/
stlink_loadfile=/home/hh/hh_share/MARM.bin
stlink_addr=0x08000000
#cmd1= sudo mount -t cifs -o username=lizhi,password="ghjkl;'",uid=1000,gid=1000 $(src1) $(dest1)
cmd1= sudo mount -t cifs -o username=lizhi,password="hjkl;'",uid=1000,gid=1000 $(src1) $(dest1)
cmd2= sudo mount -t cifs -o username=lizhi,password=8988539lizhidl,uid=1000,gid=1000 $(src4) $(dest4) 
cmd3= sudo mount -t cifs -o username=lizhi,password=8988539lizhidl,uid=1000,gid=1000 $(src5) $(dest5)
cmd4= sudo mount -t cifs -o username=lizhi,password=8988539lizhidl,uid=1000,gid=1000 $(src6) $(dest6)
cmd5= sudo mount -t cifs -o username=lizhi,password=8988539lizhidl,uid=1000,gid=1000 $(src7) $(dest7)

.PHONY:winhome  wincompany linux_share1  linux_share2  linux_share3   linux_all
winhome:
	$(cmd1)
debian2_e:
	$(cmd2)
debian2_f:
	$(cmd3)
debian2_g:
	$(cmd4)
debian2_h:
	$(cmd5)
wincompany:
	$(cmd6)
linux_all:debian2_e debian2_f debian2_g debian2_h

cmd_clip:=-r clipboard:PRIMARYCLIPBOARD
cmd_ttyUSB0:=-r comport:COM2=/dev/ttyUSB0
cmd_hh_share:=-r disk:hhshare=/home/hh/hh_share
cmd_size:=-g 1920x1020
remot_win_company_full:
	rdesktop $(cmd_clip) $(cmd_hh_share) -f 192.168.91.83 
remot_win_company:
	rdesktop -a 16 -D $(cmd_size) $(cmd_clip) $(cmd_hh_share)  192.168.91.83 
remot_win_home:
	rdesktop -a 16 -D $(cmd_size) $(cmd_clip) $(cmd_hh_share)  192.168.1.101 
stload:
	sudo $(stlink_home)st-flash write $(stlink_loadfile) $(stlink_addr)

.PHONY:win_un linux_un1  linux_un2  linux_un3 linux_un_all
win_un:
	sudo umount $(dest1)
debian2_un_e:
	sudo umount $(dest4)
debian2_un_f:
	sudo umount $(dest5)
debian2_un_g:
	sudo umount $(dest6)
debian2_un_h:
	sudo umount $(dest7)
linux_un_all:debian2_un_e debian2_un_f debian2_un_g debian2_un_h

